﻿using System.Data;

namespace TurtleEngine
{
	 /// <summary>
	 ///
	 /// </summary>
	 public static class UsersHelper
	 {
		  /// <summary>
		  /// The users
		  /// </summary>
		  private static DataTable users = new DataTable("Users");

		  /// <summary>
		  /// Gets the users.
		  /// </summary>
		  /// <value>
		  /// The users.
		  /// </value>
		  public static DataTable Users
		  {
				get { return users; }
		  }

		  /// <summary>
		  /// Gets the users.
		  /// </summary>
		  public static void GetUsers()
		  {
				users.Clear();
				users = Utility.DBConnection.GetSchema("Users");

				//Utility.PrintDatatable(users);
		  }

		  /// <summary>
		  /// Writes the users.
		  /// </summary>
		  public static void WriteUsers()
		  {
				string xmlfile = users.TableName + ".xml";
				string xslFile = users.TableName + ".xsl";
				string htmFile = users.TableName + ".htm";

				Utility.WriteXML(users, users.TableName + ".xml");
				Utility.WriteHTML(xmlfile, xslFile, htmFile);
		  }
	 }
}